const express = require('express');
var Eureka = require('eureka-client').Eureka;

const app = express();

app.get('/health', (req, res) => {
    res.json({status: 'UP'});
});
app.get('/', (req, res, next) => {
    res.json({status: true, message: "It's works!  "});
});
app.listen(6000);


var Eureka = require('eureka-client').Eureka;
const client = new Eureka({
    instance: {
        app: 'NodeServer',
        hostName: 'Node.js 127.0.0.1:6000',
        ipAddr: '127.0.0.1',
        statusPageUrl: 'http://localhost:6000',
        port: {'$': 3333, '@enabled': 'true',},
        vipAddress: 'test.something.com',
        dataCenterInfo: {'@class': 'com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo', name: 'MyOwn',},
    }, eureka: {serviceUrl: ['http://127.0.0.1:8888/eureka/apps/'],},
});
client.start(function (error) {
    console.log(error || 'Node server register completed');
});